import Mock from 'mockjs'

const order = Mock.mock({
  'items|10': [{
    orderId: '@id',
    taskNo: '@integer(0, 5000)',
    taskName: '@csentence(5, 10)',
    acceptTime: '@datetime',
    'workType|1': [1, 2],
    'taskMode|1': [2, 1],
    'orderStatus|1': [2, 1, 3, 4],
    taskCraftList: {
      useUserNum: '@integer(1, 100)'
    },
    taskFunds: {
      payAmount: '@integer(1000, 1000000)'
    }
  }]
})
const pub = {
  isMore: 0,
  pageIndex: 1,
  pageSize: 10,
  startIndex: 0,
  totalNum: 30,
  totalPage: 1
}
const dictMap = {
  workType: {
    1: 'eee',
    2: 'rrr'
  },
  taskMode: {
    1: 'ttt',
    2: 'yyy'
  },
  orderStatus: {
    1: '待接单',
    2: '待开工',
    3: '待完工',
    4: '待确认'
  }
}
export default [
  // 电工个人订单列表【网页用】
  {
    url: '/task/order/listOrderByCondition',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {
          ...order,
          ...pub
        },
        dictMap,
        msg: ''
      }
    }
  }
]
